/*******************************************************************
 * author   :  Charlies-ls
 * Date     :  2021-09-26
 * Function :  print tools
 * Copyright (c) 2021. artestplay@outlook.com. All Rights Reserved.
 *******************************************************************/

#ifndef XPRINTF_H
#define XPRINTF_H
#include <stdint.h>
#define AX_BLACK 	"\033[30m"
#define AX_RED   	"\033[31m"
#define AX_GREEN   "\033[32m"
#define AX_YELLOW  "\033[33m"
#define AX_BLUE   	"\033[34m"
#define AX_SKYBLUE "\033[35m"
#define AX_WHITE   "\033[36m"

#define AX_LIGHT_BLACK   "\033[1;30m"
#define AX_LIGHT_RED     "\033[1;31m"
#define AX_LIGHT_GREEN   "\033[1;32m"
#define AX_LIGHT_YELLOW  "\033[1;33m"
#define AX_LIGHT_BLUE    "\033[1;34m"
#define AX_LIGHT_SKYBLUE "\033[1;35m"
#define AX_LIGHT_WHITE   "\033[1;36m"
#define AX_COLOR_RESET   "\033[0m"

#define AX_PERROR AX_LIGHT_RED
#ifdef __cplusplus
extern "C" {
#endif


void ax_printf(const char* color,const char* fmt,...);
void ax_error_exit(const char* fmt,...);
void ax_info(const char*fmt,...);
void ax_debug(const char*fmt,...);
void ax_error(const char*fmt,...);

void ax_printf_hex(const uint8_t* hex,const int len,const char* tips);
void ax_printbytes(const unsigned char*bytes,const int len,const char* tips);
void ax_printints(const int *datas,const int len,const char* tips);
void ax_print_binarybyte(const uint8_t byte,const char* tips);
void ax_print_binaryuint16(const uint16_t word,const char* tips);
void ax_print_binary_dword(const uint32_t dword,const char* tips);
void ax_print_binary_dwords(const uint32_t *dword,const int len, const char* tips);
void ax_print_floats(const float* data,const int len,const char* tips);
void ax_print_doubles(const double* data,const int len,const char* tips);
void ax_print_binarybytes(const char* bytes,const int len,const char* tips);

#define LOG_DEBUG(fmt, args...) \
do {  \
        printf("[DEBUG]:");\
        printf(fmt "\n", ##args); \
} while(0);
#ifdef __cplusplus
}
#endif


#endif
